<template>
  <div class="merchant-container" :style="{background: `url('${bg}')`}">
    <a @click="handleScan" class="item">
      <img src="@/assets/img/scan.png" alt="">
      <p>扫码核销</p>
    </a>
    <a @click="handleToRecords" class="item">
      <img src="@/assets/img/record.png" alt="">
      <p>核销记录</p>
    </a>
  </div>
</template>
<script setup>
import bg from '@/assets/img/bg.png'
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import wx from 'weixin-js-sdk'
const router = useRouter()
const handleScan = () => {
  wx.miniProgram.navigateTo({
    url: '/pages/scanUrl/scanUrl?redirctUrl=' + encodeURIComponent("https://zghz.zgh.wuxi.gov.cn/dwhd/#/confirm")
  })
}
const handleToRecords = () => {
  router.push('/records')
}
</script>
<style lang="less">
.merchant-container{
  min-height: 100vh;
  overflow: hidden;
  background-size: 100%;
  background-color: #f1f3f4;
  padding-top: 20px;
  .item {
    background: #fff;
    display: block;
    border-radius: 16px;
    text-align: center;
    padding: 30px 0;
    margin: 0 20px;
    margin-top: 20px;
    img{
      display: inline-block;
      width: 100px;
    }
    p{
      color: #333;  
      font-size: 16px;  
    }
  }
}
</style>